package com.study.csc.a08threadjoin5;


import com.study.csc.a07threadmethod4.MyThread;

/**
 * @author csc
 * @Date 2023/10/18 16:29
 * @PackageName:com.study.csc.a05threadmethod2
 * @ClassName: ThreadDemo
 * @Description: TODO
 * @Version 1.0
 */
public class ThreadDemo {

    public static void main(String[] args) throws InterruptedException {

        /*
          public static void join()     | 插入线程/插队线程

        */

       MyThread t = new MyThread();

       t.setName("土豆");

       t.start();

       //表示把t这个线程,插入到当前线程之前.
       // t: 土豆
       // 当前线程是什么呢？: main线程
       t.join();

       //执行在main线程当中的
        for (int i = 0; i < 10 ; i++) {
            System.out.println("main线程"+i);
        }

    }

}
